package com.yyp.car.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import com.yyp.car.Iservice.ITestTypeService;
import com.yyp.car.model.TestType;

@Controller
@RequestMapping("/testType")
public class TestTypeController {
	@Resource(name="testTypeService")
	private ITestTypeService testTypeService;
	
	@RequestMapping("/addTestType")
	public String addtestType(TestType testType){
		testTypeService.addtestType(testType);
		return "redirect:/back/testTypeManager";
	}
	
	@RequestMapping("/updateTestType")
	public String updatetestType(TestType testType){
		testTypeService.updateTestType(testType); 
		return "redirect:/back/testTypeManager";
	}
	
	@RequestMapping("/deleteTestType/{id}")
	public String deletetestType(@PathVariable int id){
		testTypeService.delete(id);
		return "redirect:/back/testTypeManager";
	}

}
